#!/bin/sh

GNUPLOT=/usr/bin/gnuplot 

$GNUPLOT > runOut.png << EOF
set terminal png
set autoscale y
#set logscale n
set grid
set size ratio 0.6
set key below
#set log y
set xlabel "Time"
set ylabel "ms"

plot \
"runOut.txt" using 1:4 title 'TCP connect time' with linespoints,\
"runOut.txt" using 1:5 title 'JDBC connect time' with linespoints
EOF

$GNUPLOT > runOut_stmts.png << EOF
set terminal png
set autoscale y
#set logscale n
set grid
set size ratio 0.6
set key below
#set log y
set xlabel "Time"
set ylabel "ms"

plot \
"runOut.txt" using 1:7 title 'INSERT time' with linespoints,\
"runOut.txt" using 1:8 title 'SELECT time' with linespoints,\
"runOut.txt" using 1:9 title 'UPDATE time' with linespoints,\
"runOut.txt" using 1:10 title 'DELETE time' with linespoints,\
"runOut.txt" using 1:11 title 'PL/SQL time' with linespoints
EOF

gqview *.png

